How to define custom log categories in Unreal C++
Place this in a header file and include it to reuse a log category between multiple source files Arguments:
LogTemp if you don't want to define a category.Fatal, Error, Warning, Display, Log, Verbose, VeryVerboseDECLARE_LOG_CATEGORY_EXTERN(MyLogCategory, Log, All);
Place this in your log definition's .cpp file to define it
DEFINE_LOG_CATEGORY(MyLogCategory);
Place this on your code when you want to log something Arguments:
UE_LOG(MyLogCategory, Log, TEXT("Your log message goes here."));
You can also use sprintf()-like string formatting to log variables:
int32 MyValue = 10;
UE_LOG(MyLogCategory, Log, TEXT("Your variable value is: %d"), MyValue);
by amber